package com.kh.pajx.sop.dao.sys.impl;

import java.util.List;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.kh.pajx.sop.base.BaseDaoImpl;
import com.kh.pajx.sop.dao.sys.ISysDeptAreaDao;
import com.kh.pajx.sop.domain.SysDeptArea;

@Service
@Transactional
@SuppressWarnings("unchecked")
public class SysDeptAreaDaoImpl extends BaseDaoImpl<SysDeptArea> implements
		ISysDeptAreaDao {

	@Override
	public List<SysDeptArea> getSysDeptAreaByDeptCode(String deptCode) {
		return getSession().createQuery(//
				"from SysDeptArea s where s.deptCode=?")//
				.setParameter(0, deptCode)//
				.list();
	}
	
	@Override
	public List<String> getAreaCodeByDeptCode(String deptCode) throws Exception{
		return getSession().createQuery(//
				"SELECT t.areaCode FROM SysDeptArea t WHERE t.deptCode=?") //
				.setParameter(0, deptCode)
				.list();
		
	}

	

}
